package pattern12.overtime;

/**
 * 上午的工作状态
 * @author wdl
 */
public class ForenoonState implements IState {
    @Override
    public void writeProgram(Work work) {
        if (work.getHour()<12){
            System.out.println("当前时间"+work.getHour()+",上午工作，精神百倍");
        }else {
            //不满足条件则切换到下一个状态
            work.setState(new NoonSate());
            work.writeProgram();
        }
    }
}
